home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 1PKIAH1 (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.0 KB  |  25 lines

  1. package com.sun.java.swing.text;
  2.  
  3. import java.awt.event.ActionEvent;
  4.  
  5. class DefaultEditorKit$BeginAction extends TextAction {
  6.    private boolean select;
  7.  
  8.    DefaultEditorKit$BeginAction(String nm, boolean select) {
  9.       super(nm);
  10.       this.select = select;
  11.    }
  12.  
  13.    public void actionPerformed(ActionEvent e) {
  14.       JTextComponent target = ((TextAction)this).getTextComponent(e);
  15.       if (target != null) {
  16.          if (this.select) {
  17.             target.moveCaretPosition(0);
  18.          } else {
  19.             target.setCaretPosition(0);
  20.          }
  21.       }
  22.  
  23.    }
  24. }
  25.